package com.prothink.threadadmindemo.exception;

import com.prothink.threadadmindemo.vo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author mayanping
 * @title: ExceptionHandler
 * @projectName ThreadAdminDemo
 * @description: 全局异常处理类
 * @date 2024/9/1115:58
 */
@RestControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(BisnessException.class)
    public Result<String> handlerBusinessException(BisnessException bisnessException){
        return Result.failure(bisnessException.getMessage());
    }
}
